package com.snail.common.entity;

import lombok.Data;

import java.util.List;

@Data
public class Page {

    /**
     * 每页显示条数
     */
    private Integer limit = 10;
    /**
     * 当前第几页
     */
    private Integer curr = 1;
    /**
     * 分页总数
     */
    private Long pageCount;
    /**
     * 总数
     */
    private Long count;

    private List data;

    public Page() {
        if (limit == null) {
            limit = 15;
        }
        if (curr == null) {
            curr = 1;
        }
    }

    public Page(int limit, int curr, Long pageCount, Long count, List data) {
        this.limit = limit;
        this.curr = curr;
        this.pageCount = pageCount;
        this.count = count;
        this.data = data;
    }
}
